<script type="text/javascript">
$(function(){	
	
	$( "#finalcancel").click(function() {	
	var booking_id=$(this).attr('alt');
				$.ajax({
					   type: "POST",
					   url: 'final_cancel_booking.php',
					   data: "booking_id="+booking_id, // serializes the form's elements.
					   success: function(data)
					   {
						  alert(data);
						   
					   }
					 });
					 return false;
														 
	});

});
</script>
<?php if (!isset($_SESSION)) { session_start(); }
include("includes/db.conn.php");
include("includes/conf.class.php");
$checkexist=mysql_query("select * from netbiz_bookings where booking_id=".$_POST['booking_id']." and otp='".$_POST['otp']."'");
if(mysql_num_rows($checkexist))
{	
	$sql=mysql_query("select * from netbiz_booking_details as bd, netbiz_special_offer as so,netbiz_roomtype as rt,netbiz_capacity as cap,netbiz_hotels as hot where bd.room_type_id=rt.roomtype_ID and bd.capacity_id=cap.id and bd.hotel_id=hot.hotel_id and bd.offer_id=so.id and  bd.booking_id='".$_POST['booking_id']."'");
		$i=1;		
	while($row=mysql_fetch_array($sql))
	{
	echo '<table width="500" cellpadding="0" cellspacing="2" border="0" height="120"><tr><td colspan="2" width="80" height"=30"><strong>Booking '.$i.'</strong></td></tr><tr><td>Booking Id :</td><td>'.$_POST['booking_id'].'</td></tr>
	<tr><td>Hotel Name :</td><td>'.$row['hotel_name'].'</td></tr>	
	<tr><td>Status :</td><td>Confirmed</td></tr></table>';
	$i++;
	}
	echo '<a href="javascript:void(0);" id="finalcancel" alt="'.$_POST['booking_id'].'"><img src="images/but_yescancle1.png" align="absmiddle"></a>';
	echo "&nbsp;&nbsp;&nbsp; <strong>or</strong>&nbsp;&nbsp;&nbsp; No, i don't want to cancel";
}
else
{
	echo 'no';
}

?>